<?php
  
  //This file contains the global variables that will be used to avoid excess hardcoding
  
  $DOCTYPE = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
                              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
  $HTMLOPEN = '<html xmlns="http://www.w3.org/1999/xhtml">';

  $QUOTA_LOCATION = "../conf/quota.txt";

  $CHARSET = '<meta http-equiv = "content-type" content="text/html; charset=UTF-8" />';
  $CSS = '<link rel="stylesheet" type="text/css" href="Stylesheet.css" />';
  
  // STUFF TO BE CHANGED/NOT YET USED
  $ICON = '<link rel="shortcut icon" href="../images/icon.png" type="image/x-icon" />';
  $LOGO = '<img id="logo" src="../images/Logo-Border.png" alt="Logo"/>';
 
  function create_combobox($context,$paramName,$withAny,$SelectedValue = null)
  {
		$queryresult =	mysql_query("SELECT * FROM HSOBO_REFERENCE_CODES WHERE CODE_TYPE = '" . $context ."' ORDER BY SORT_ORDER ASC");
		
		$combostring = "<select name=" . $paramName . ">";
		
		if($withAny)
		{
			$combostring .= "<option value=\"-1\">Any</option>";
		}
		while($row = mysql_fetch_assoc($queryresult))
		  {
			if($SelectedValue == $row['CODE_VALUE'])
			{
				$combostring .= "<option value=\"".$row['CODE_VALUE'] ."\" selected >" .$row['MEANING'] . "</option>";
			}else{
				$combostring .= "<option value=\"".$row['CODE_VALUE'] ."\">" .$row['MEANING'] . "</option>";
			}
		  }
		
		$combostring .= "</select>";
		
		return $combostring;
  }
  
  function AndOrWhere($string)
  {
	if(empty($string))
	{
		return " WHERE ";
	}else{
		return " AND ";
	}	
  }
?>
